Skip to content

Add Code Action for adding a module to your project's cabal file #4617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VeryMilkyJoe
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe commented Jun 7, 2025

For diagnostics complaining about the current haskell module being unknown, we now offer all possible code actions to add the module to a field in the responsible cabal file.

Additionally, this PR refactors the cabal-plugin into smaller modules and also refactors the add-package feature to have some shared functions to be used for both add-package and add-module.

Thank you to @Bodigrim for the changes in cabal-add that made it possible to implement this feature without a huge amount of pain!

Screencast.From.2025-06-07.17-49-54.mp4

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 3 times, most recently from 61bf7ee to 16bef12 Compare June 8, 2025 08:50
@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from 16bef12 to 234cb09 Compare June 9, 2025 14:14
@Bodigrim
Copy link
Contributor

@VeryMilkyJoe please upgrade to the latest commit of cabal-add, Bodigrim/cabal-add@d831980. Once you confirm that it works well, I'll make a release.

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 2 times, most recently from c40661e to 56144e4 Compare June 16, 2025 09:44
@VeryMilkyJoe
Copy link
Collaborator Author

@VeryMilkyJoe please upgrade to the latest commit of cabal-add, Bodigrim/cabal-add@d831980. Once you confirm that it works well, I'll make a release.

Done and all tests that matter are green :)

@Bodigrim
Copy link
Contributor

@VeryMilkyJoe here you go: https://hackage.haskell.org/package/cabal-add-0.2

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from 56144e4 to 6a950f1 Compare June 17, 2025 15:10
@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 6 times, most recently from c93ce2a to 47a6dca Compare July 9, 2025 14:42
@VeryMilkyJoe
Copy link
Collaborator Author

In my opinion, this is in a merge ready state, unless anyone wants to look over it again 🙃 @fendor?

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from 47a6dca to 0a2f28d Compare August 6, 2025 14:50
For diagnostics complaining about the current module being unknown,
we now offer code actions to add the module to any possible field in
the responsible cabal file.

Additionally, refactor the cabal-plugin into smaller modules and
refactor the add-package feature to have some shared functions to be
used for both add-package and add-module.
@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from 0a2f28d to 20759b0 Compare August 6, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants